package com.geeksaga.service;

import java.util.List;
import java.util.Map;


import org.springframework.dao.DataAccessException;

import com.geeksaga.domain.PrimaryCode;
import com.geeksaga.domain.SecondaryCode;

/**
 * @author newbie
 * @since 0.1
 */
public interface CodeService {
	
    /**
     * @param primaryCode
     * @return
     * @throws DataAccessException
     */
    public PrimaryCode add(PrimaryCode primaryCode) throws DataAccessException;
    
    /**
     * @param primaryCode
     * @return
     * @throws DataAccessException
     */
    public PrimaryCode find(PrimaryCode primaryCode) throws DataAccessException;
    
    /**
     * @return
     * @throws DataAccessException
     */
    public List<SecondaryCode> findList() throws DataAccessException;
    
    /**
     * @throws DataAccessException
     */
    public void loadCodeCache() throws DataAccessException;
    
    /**
     * @param primaryCode
     * @return
     */
    public Map<String, String> findCacheByPrimaryCode(String primaryCode);
    
    /**
     * @param primaryCode
     * @return
     */
    public Map<String, String> findCacheValueByPrimaryCode(String primaryCode);
    
    /**
     * @param primaryCode
     * @return
     */
    public Map<String, SecondaryCode> findCacheTreeByPrimaryCode(String primaryCode);
    
    /**
     * @return
     * @throws DataAccessException
     */
    public int count() throws DataAccessException;
    
    /**
     * @param primaryCode
     * @return
     * @throws DataAccessException
     */
    public PrimaryCode modify(PrimaryCode primaryCode) throws DataAccessException;
    
    /**
     * @param primaryCode
     * @return
     * @throws DataAccessException
     */
    public PrimaryCode remove(PrimaryCode primaryCode) throws DataAccessException;
}